import Vue from 'vue'

// 将所有审核组件注册为全局组件
export function loadAllComponent(data) {
  const requireComponent = require.context("@/components/AuditComponents/", false, /Audit[a-zA-Z]+\.(vue)$/);
  requireComponent.keys().forEach((fileName) => {
    const componentConfig = requireComponent(fileName);
    const componentName = componentConfig.default.name;
    // 全局注册组件
    Vue.component(
      componentName,
      componentConfig.default || componentConfig
    );
  });
}
